#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main() {
    int n, m, s;
    cin >> n >> m >> s;
    vector<int> fruits(n);
    for (int i = 0; i < n; ++i) {
        cin >> fruits[i];
    }
    vector<int> dp(n + 1);
    for (int i = 0; i < n; ++i) {
        int maxF = fruits[i];
        int minF = fruits[i];
        dp[i + 1] = dp[i] + m * s;
        for (int j = i; j >= 0; --j) {
            maxF = max(maxF, fruits[j]);
            minF = min(minF, fruits[j]);

            if (i - j + 1 > m) {
                break;
            }

            int cost = (i - j + 1) * (int) floor((double) (minF + maxF) / 2.) + (s);
            dp[i + 1] = min(dp[i + 1], dp[j] + cost);
        }
    }

    std::cout << dp[n] << std::endl;
    return 0;
}
